package com.zyx.qrcode;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.resource.ClassPathResource;

import java.io.BufferedOutputStream;
import java.nio.charset.StandardCharsets;

/**
 * <p>
 *
 * @author Yaxi.Zhang
 * @since 2022/10/5 07:18
 */
public class Test {
    public static void main(String[] args) throws Exception {
        String imgPath = "com-zyx-qrcode/src/main/resources/二维码12.png";
        String content = FileUtil.readString(new ClassPathResource("LogoUtil.java").getFile(), StandardCharsets.UTF_8);
        String logo = "com-zyx-qrcode/src/main/resources/logo.png";
        // 加密：文字信息->二维码
        ZXingUtil.encodeImg(imgPath, "png", content, 400, 400, logo);
        // 解密：二维码  ->文字信息
        // ZXingUtil.decodeImg(new File(imgPath));
    }
}
